#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
int arr[10];
LL a, b, c;
int main()
{
	for (int i = 0; i < 4; i++) {
		cin >> arr[i];
	}
	sort(arr, arr + 4);
	/*for (int i = 0; i < 4; i++) {
		cout << arr[i] << " ";
	}
	cout << endl;*/
	a = arr[3] - arr[2];
	b = arr[3] - arr[1];
	c = arr[3] - arr[0];
	cout << a << " " << b << " " << c << endl;
	return 0;
}